import React from 'react';
import { inject, observer } from 'mobx-react';

@inject('portalThemeStore')
@observer
class E8TopLogo extends React.Component {
  render() {
    const { portalThemeStore } = this.props;
    const { themeInfo = {} } = portalThemeStore;
    const { themeLogo, themeLogoName, themeLogoWidth, themeData = {} } = themeInfo;
    const { logocolor } = themeData;
    const logoWidth = themeLogoWidth == '' ? 225 : parseInt(themeLogoWidth);

    return (
      <div className="e8header-top-logo wea-f14" style={logocolor ? { backgroundColor: logocolor, width: logoWidth } : { width: logoWidth }}>
        {themeLogo ? <img src={themeLogo} alt="" /> : <span>{themeLogoName}</span>}
      </div>
    );
  }
}

export default E8TopLogo;
